<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <link rel="stylesheet" href="css/wifi.css">
    <title></title>
</head>

<body>
<div class="main">
<a href="javascript:void(0)" class="btn pop_btn">一 键 注 册</a>
<a class="wifi_tel" href="tel:4006986808"></a>
<div class="sign_wrap sign_wrap1">
    <form action="" class="sign_cnt">
    <a href="javascript:void(0)" class="close">&times;</a>
    <h2 class="sign_tit">注册云中宝</h2>
    <div class="form_group select_type_wrap">
        <label class="form_label radio_type" for="">
        <input class="" type="radio" id="" name="select_type" checked>
        企业</label>
        <label class="form_label radio_type" for="">
        <input class="" type="radio" id="" name="select_type">
        个人</label>
    </div>
    <div class="form_group">
        <label class="form_label" for="">登录手机号</label>
        <input class="form_input sign_input" type="text" id="sign_input" name="sign_input" placeholder="请输入手机号">
    </div>
    <div class="form_group">
        <input class="" type="checkbox" id="agree" name="agree" checked disabled>&nbsp;<a href="http://www.dodohr.com/company/privacy" class="agree_text">我同意用户协议</a>
    </div>
    <div class="form_group form_btn">
        <a href="javascript:void(0)" class="btn sign_btn">注&nbsp;&nbsp;&nbsp;&nbsp;册</a>
    </div>       
    </form>
    <div class="sign_dialog">
        <p class="dialog_text"></p>
        <a href="javascript:void(0)" class="btn dialog_close">确定</a>
    </div>
    </div>

<script>
var _btn = document.querySelector('.pop_btn')
var _sign_wrap = document.querySelector('.sign_wrap')
var _close = document.querySelector('.close')
var _sign_input = document.getElementById('sign_input')
var _sign_cnt = document.querySelector('.sign_cnt')
var _sign_dialog = document.querySelector('.sign_dialog')
var _dialog_close = document.querySelector('.dialog_close')
var closeTimer
_btn.onclick= function(){
   addClass(_sign_wrap,'show')
   addClass(_sign_cnt,'slide')
}
var _sign_btn = document.querySelector('.sign_btn')
_sign_btn.onclick= function(){
   removeClass(_sign_cnt,'slide')
   _sign_input.value=''
   addClass(_sign_dialog,'slide')
   document.querySelector('.dialog_text').innerHTML='注册成功!<br/>我们的客服人员会在工作日和您联系开通社保服务，企业用户可以访问云中宝官方网站<a href="http://www.dodohr.com" style="color:#09b2cd">www.dodohr.com</a>开通更多功能'
   closeTimer = setTimeout(function(){
      removeClass(_sign_dialog,'slide')
      removeClass(_sign_wrap,'show') 
   },5000)
}
_close.onclick= function(){
   removeClass(_sign_wrap,'show')
   _sign_input.value=''
}
_dialog_close.onclick =function(){
   clearTimeout(closeTimer)
   removeClass(_sign_dialog,'slide')
   removeClass(_sign_wrap,'show')
   _sign_input.value=''
}
function hasClass(el,cls){
    var elClsArr = el.className.split(' ');
    for(var i=0,len=elClsArr.length;i<len;i++){
        if(elClsArr[i] == cls){
            return true
        }
    }
    return false
}
function addClass(el,cls){
    var elClsArr = el.className.split(' ');
    for(var i=0,len=elClsArr.length;i<len;i++){
        if(elClsArr[i] == cls){
            return false
        }
    }
    el.className += (' '+cls)
}
// removeClass, takes two params: element and classname
function removeClass(el, cls) {
  var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
  el.className = el.className.replace(reg, " ").replace(/(^\s*)|(\s*$)/g,"");
}    
</script>    
</div>   
</body>
</html>